﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AspDatabases
{
    public partial class Continents : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!Page.IsPostBack) 
            //{
            //    this.ListBoxContinents.SelectedIndex = 0;
            //    this.EntityDataSourceCountries.Where = "it.ContinentID = " + this.ListBoxContinents.SelectedValue;
            //}
        }

        protected void OnContinentSelect(object sender, EventArgs e)
        {
            this.EntityDataSourceCountries.Where = "it.ContinentID = " + this.ListBoxContinents.SelectedValue;
            this.GridViewCountries.Visible = true;
            this.ListViewTowns.Visible = false;
        }

        protected void CountrySelected(object sender, EventArgs e) 
        {
            this.EntityDataSourceTowns.Where = "it.CountrieID = " + this.GridViewCountries.SelectedValue;
            this.ListViewTowns.Visible = true;
        }
    }
}